package com.enhe.gck.controller;

import com.enhe.gck.communal.Resp;
import com.enhe.gck.pojo.Batch;
import com.enhe.gck.service.impl.BatchService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("test")
public class TestController {

    @Resource
    private BatchService batchService;

    @GetMapping("getAvailableBatchWithoutPackageDate/{type}/{batchType}")
    public Resp<List<Batch>> getAvailableBatchWithoutPackageDate(@PathVariable String type, @PathVariable String batchType) {
        return Resp.success(batchService.getAvailableBatchListWithoutPackageDate(type, batchType));
    }

    @GetMapping("getAvailableBatchList/{type}/{batchType}")
    public Resp<List<Batch>> getAvailableBatchList(@PathVariable String type, @PathVariable String batchType) {
        return Resp.success(batchService.getAvailableBatchList(type, batchType));
    }

}
